def checklib(name, conf):
	if not conf.CheckLib(name):
		Exit(1)

env = Environment()

if env["PLATFORM"] == "win32":
	env.Append(CPPDEFINES = ["WIN32"])
	env.Append(CPPPATH = ["C:/dev/include/stlport", "C:/dev/include", "C:/dev/include/bullet", "./src"])
	env.Append(LIBPATH = ["C:/dev/lib"])
	env.Append(CCFLAGS = ["/O2"])

	conf = Configure(env)
	checklib("opengl32", conf)
	checklib("glu32", conf)
	checklib("stlport.5.2", conf)
	checklib("SDL", conf)
	checklib("SDLmain", conf)
	checklib("SDL_image", conf)
	checklib("BulletCollision", conf)
	checklib("BulletDynamics", conf)
	checklib("LinearMath", conf)
	env = conf.Finish();
	env.Append(LIBS = ["stlport.5.2", "opengl32", "glu32", "SDL", "SDLmain", "SDL_image", "BulletCollision", "BulletDynamics", "LinearMath"])
	
src_files = Split("""
	./src/art/RGBA.cpp
	./src/event/Action.cpp
	./src/event/EventHandler.cpp
	./src/event/KeyPressed.cpp
	./src/event/SimpleFinalEventHandler.cpp
	./src/Game.cpp
	./src/GameWindow.cpp
	./src/loader/TokenLine.cpp
	./src/mesh/DwarfMeshLoader.cpp
	./src/mesh/Material.cpp
	./src/mesh/MaterialLibrary.cpp
	./src/mesh/Mesh.cpp
	./src/mesh/MeshLibrary.cpp
	./src/mesh/MeshLoader.cpp
	./src/mesh/MeshUtil.cpp
	./src/mesh/OBJMeshLoader.cpp
	./src/texture/Texture.cpp
	./src/texture/TextureLibrary.cpp
	./src/util/FileUtil.cpp
	./src/util/StringUtil.cpp
	./src/util/Timer.cpp
	./src/world/AxisPrototype.cpp
	./src/world/Camera.cpp
	./src/world/Character.cpp
	./src/world/Drawable.cpp
	./src/world/Object.cpp
	./src/world/ObjectMotionState.cpp
	./src/world/RigidBody.cpp
	./src/world/World.cpp""")

env.StaticLibrary(target = "dwarf3d", source = src_files)